<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: 86153
  Date: 2023/3/19
  Time: 14:07
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath() + "/";
%>


<html>
<head>
	<base href="<%=basePath%>">
	<link href="css/haiersoft.css" rel="stylesheet" type="text/css" media="screen,print"/>
	<link href="css/print.css" rel="stylesheet" type="text/css" media="print"/>
	<script src="js/jquery-1.10.1.min.js"></script>
	<script src="js/side.js" type="text/javascript"></script>
	<script src="js/jquery-3.6.0.js"></script>
	<script>
        function Delete_Soldier(mobile) {
            var mobile1 = mobile;
            $.ajax({
                url: 'admin_info/Delete_Soldier',
                type: 'POST',
                data: {
                    mobile: mobile1
                },
                success: function (data) {
                    if (data.code == '0011') {
                        console.log(data.masage);
                        alert("删除成功");
                        window.location.reload();
                    } else if (data.code == '0010') {
                        console.log(data.masage);
                        alert("删除失败");
                    }
                }
            })
        }
	</script>
	<style>
        .tr1 {
            position: absolute;
            top: 100px;
        }

        .tdColor1 {
            width: 203px;
            height: 40px;
            background-color: #f2f2f2;
            color: #438eb9;
        }
	</style>
</head>
<body>
<div id="MainForm">
	<div class="form_boxA">
		<div class="page">
			<img src="img/coin02.png"/><span><a href="<c:url value="/jsp/admin_view.jsp"/>">&nbsp;&nbsp首页</a>&nbsp;-&nbsp;-</span>&nbsp;退役军人信息
		</div>
		<h2>退役军人列表</h2>
		<table class="tr1">
			<tr>
				<td width="203px" class="tdColor1">姓名</td>
				<td width="203px" class="tdColor1">年龄</td>
				<td width="203px" class="tdColor1">籍贯</td>
				<td width="203px" class="tdColor1">现住址</td>
				<td width="203px" class="tdColor1">服役时间</td>
				<td width="203px" class="tdColor1">退役时间</td>
				<td width="203px" class="tdColor1">工作状态</td>
				<td width="203px" class="tdColor1">手机号</td>
				<td width="143px" class="tdColor1">操作</td>
			</tr>
			<c:forEach items="${soldierInfo}" var="s">
				<tr>
					<td>${s.soldierName}</td>
					<td>${s.soldierAge}</td>
					<td>${s.soldierOrigin}</td>
					<td>${s.homeLocal}</td>
					<td>${s.serviceTime}</td>
					<td>${s.decommissioningTime}</td>
					<td>${s.psStatus}</td>
					<td>${s.mobile}</td>
					<td>
						<button onclick="Delete_Soldier(${s.mobile})"><img class="operation delban"
						                                                   src="img/delete.png"></button>
						<button><a
								href="<c:url value="/jsp/update_soldier.jsp?mobile=${s.mobile}&soldierName=${s.soldierName}&soldierAge=${s.soldierAge}
&soldierOrigin=${s.soldierOrigin}&homeLocal=${s.homeLocal}&serviceTime=${s.serviceTime}&decommissioningTime=${s.decommissioningTime}&psStatus=${s.psStatus}"/>"><img
								class="operation" src="img/update.png"></a></button>
					</td>
				</tr>
			</c:forEach>
		</table>
	</div>
</div>
</body>
</html>
